<%-- 
    Document   : login
    Created on : Aug 4, 2012, 1:53:32 AM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<script type="text/javascript">
    function validationData()
    {

        if(document.loginForm.txtUserName.value=="")
        {
            alert("* Please enter username");
            document.loginForm.txtUserName.focus();
            return false;
        }
        else if(document.loginForm.txtPassword.value=="")
        {
            alert("* Please enter password");
            document.loginForm.txtPassword.focus();
            return false;
        }
        
        return true;
    }
</script>

<c:if test="${empty user}">
    <h2>Login Form</h2>
    <ul class="back_title">
        <li class="top">&emsp;</li>
    </ul>
    <form action="Controllers" name="loginForm" onsubmit="return validationData()" method="post">
        <table width="205px" cellspacing="5">
            <tr>

                <td>
                    &emsp;Username :
                </td>
                <td><input type="text" name="txtUserName" value="" size="10" /></td>
            </tr>
            <tr>
                <td>
                    &emsp;Password :
                </td>
                <td><input type="password" name="txtPassword" value="" size="10" /></td>
            </tr>
            <tr>
                <td></td>
                <td id="buttonSize" style="text-align: left;"><div class="demo"><input  height="10px" type="submit" name="btAction" value="Logins" /></div></td>
            </tr>
            <tr>
                <td>&zwnj;</td>
            </tr>
        </table>
    </form>
</c:if>
<c:if test="${not empty user}">
    <h2>Welcome!</h2>
    <ul class="back_title">
        <li class="top" style="padding-left: 16px;color: indianred; font-weight: bold;">Welcome,${sessionScope.aha}</li>
        <li>
        <a href="Profile">Change Profile</a></li>
        <li><a href="Logout.jsp">Logout</a></li>
    </ul>
